﻿/****************************************************
	文件：SysMsg.cs
	作者：HuskyT
	邮箱:  1005240602@qq.com
	日期：2020/04/26 15:52   	
	功能：系统类 消息
*****************************************************/

using ProtoBuf;

namespace HTServer.Proto
{
    /// <summary>
    /// 秘钥协议
    /// </summary>
    [ProtoContract]
    public class MsgSecret : MsgBase
    {
        #region Necessary
        //每个协议都必有构造函数来确定协议类型；标记的成员变量ProtoType
        //因为协议加密时，被加密的不能为空，协议类型的存在保证了其不为空
        public MsgSecret()
        {
            ProtoType = ProtocolEnum.MsgSecret;
        }
        [ProtoMember(1)]
        public override ProtocolEnum ProtoType { get; set; }
        #endregion

        /// <summary>
        /// 秘钥
        /// </summary>
        [ProtoMember(2)]
        public string SecretKey;
    }
    /// <summary>
    /// 心跳包协议
    /// </summary>
    [ProtoContract]
    public class MsgPing : MsgBase
    {
        public MsgPing()
        {
            ProtoType = ProtocolEnum.MsgPing;
        }
        [ProtoMember(1)]
        public override ProtocolEnum ProtoType { get; set; }
    }


    #region Test
    /// <summary>
    /// 分包测试协议
    /// </summary>
    [ProtoContract]
    public class MsgTestSubcontract : MsgBase
    {
        public MsgTestSubcontract()
        {
            ProtoType = ProtocolEnum.MsgTestSubcontract;
        }
        [ProtoMember(1)]
        public override ProtocolEnum ProtoType { get; set; }
        [ProtoMember(2)]
        public string ReqContent { get; set; }
        [ProtoMember(3)]
        public string RecContent { get; set; }
    }
    /// <summary>
    /// 粘包测试协议
    /// </summary>
    [ProtoContract]
    public class MsgTestStick : MsgBase
    {
        public MsgTestStick()
        {
            ProtoType = ProtocolEnum.MsgTestStick;
        }
        [ProtoMember(1)]
        public override ProtocolEnum ProtoType { get; set; }
        [ProtoMember(2)]
        public string ReqContent { get; set; }
        [ProtoMember(3)]
        public string RecContent { get; set; }
    }
    #endregion


}